-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/raluca/Dropbox/Replication/PSRM/replication/analysis_log.log
  log type:  text
 opened on:   4 Jun 2021, 11:47:46

. 
. 
. /****************************************************************
> Title: Divisive Jobs 
> Author: Raluca L. Pahontu
> *****************************************************************/
. 
. qui{

. do "2-tab1" // Produces Table 1

. /********************************************************************
> Table 1: Fixed Effects Analysis: Risk and Social Spending Demand
> Author: Raluca L. Pahontu
> ********************************************************************/
. 
. *Column 1 
. qui xtreg spending_demand i.rho $cfe   , fe cl(idpers) 

. estimate store table1column1

. outreg2 using "tab1.doc", replace  dec(2) keep(2.rho 3.rho) 
tab1.doc
dir : seeout

. 
. *Column 2
. qui xtreg spending_demand i.rho $cfe $csim , fe cl(idpers)  

. estimate store table1column2

. outreg2 using "tab1.doc", append  dec(2) keep(2.rho 3.rho) 
tab1.doc
dir : seeout

. 
. *Column 3
. qui xtreg spending_demand i.rho $cfe $csim $crest , fe cl(idpers) 

. estimate store table1column3

. outreg2 using "tab1.doc",   dec(2) keep(2.rho 3.rho)  append tex
tab1.tex
tab1.doc
dir : seeout

. 
. 
. esttab table1column*, b(a1) se star(* 0.10 ** 0.05 *** 0.01)  keep(2.rho 3.rho) /// 
> coeflabels(2.rho  "Risk Rho2 " 3.rho "Risk Rho1")

------------------------------------------------------------
                      (1)             (2)             (3)   
             spending_d~d    spending_d~d    spending_d~d   
------------------------------------------------------------
Risk Rho2           -0.03**         -0.03**         -0.03** 
                   (0.02)          (0.02)          (0.02)   

Risk Rho1           -0.05***        -0.05***        -0.05***
                   (0.02)          (0.02)          (0.02)   
------------------------------------------------------------
N                   39764           39764           39764   
------------------------------------------------------------
Standard errors in parentheses
* p<0.10, ** p<0.05, *** p<0.01

. 
end of do-file

. do "3-tabd1" // Produces Table D1

. /****************************
> Table D1: Summary Statistics
> Author: Raluca L. Pahontu
> ****************************/
. 
. preserve 

. use $vars using "shp", clear
( )

. qui tab rho, gen(rho_)

. qui tab new_educ, gen(new_educ_)

. qui tab civil_status, gen(civil_status_)

. qui xi: estpost sum  spending_demand rho_2 rho_3 log_household_income new_educ_2 new_educ_3 civil_status_2 civil_status_3 owner 

. esttab, replace cells("mean(fmt(3)) sd(fmt(3)) min max") noobs  ///
> coeflabels(spending_demand  "Social Spending" ///
> rho_2 "Risk Rho2" ///
> rho_3 "Risk Rho1" ///
> log_household_income "Household Income (Log)" ///
> new_educ_2 "Medium Education" ///
> new_educ_3 "High Education" ///
> civil_status_2 "Married" /// 
> civil_status_3 "Divorced" /// 
> owner "Owner")

----------------------------------------------------------------
                      (1)                                       
                                                                
                     mean           sd          min          max
----------------------------------------------------------------
Social Spe~g        0.414        0.493        0.000        1.000
Risk Rho2           0.178        0.382        0.000        1.000
Risk Rho1           0.797        0.402        0.000        1.000
Household ~)       10.996        0.493        6.908       14.539
Medium Edu~n        0.468        0.499        0.000        1.000
High Educa~n        0.399        0.490        0.000        1.000
Married             0.572        0.495        0.000        1.000
Divorced            0.111        0.315        0.000        1.000
Owner               0.525        0.499        0.000        1.000
----------------------------------------------------------------

. qui esttab using "tabd1.tex", label booktabs cells("mean(fmt(3)) sd(fmt(3)) min max") replace nomtitle nonum

. restore

. 
end of do-file

. do "4-tabd2" // Produces Table D2

. /****************************************************************
> Table D2: Characteristics of Respondents by Number of Contact
> Author: Raluca L. Pahontu
> *****************************************************************/
. preserve

. use $vars  using "shp", clear
( )

. bysort idpers: egen how_many= count(idpers)

. qui gen min2 = 1 if how_many >1

. qui replace min2 = 0 if how_many == 1

. qui tab rho, gen(rho_)

. qui tab new_educ, gen(new_educ_)

. qui tab civil_status, gen(civil_status_)

. qui xi: estpost sum  social_spending rho_2 rho_3 log_household_income new_educ_2 new_educ_3 civil_status_2 civil_status_3 owner if min2 == 0

. esttab, replace cells("mean(fmt(2))") noobs  ///
> coeflabels(social_spending  "Social Spending" ///
> rho_2 "Risk Rho2" ///
> rho_3 "Risk Rho1" ///
> log_household_income "Household Income (Log)" ///
> new_educ_2 "Medium Education" ///
> new_educ_3 "High Education" ///
> civil_status_2 "Married" /// 
> civil_status_3 "Divorced" /// 
> owner "Owner")

-------------------------
                      (1)
                         
                     mean
-------------------------
Social Spe~g         0.57
Risk Rho2            0.24
Risk Rho1            0.70
Household ~)        10.89
Medium Edu~n         0.44
High Educa~n         0.25
Married              0.39
Divorced             0.10
Owner                0.47
-------------------------

. qui esttab using "tabd2.tex", label booktabs cells("mean(fmt(2))") replace nomtitle nonum

. qui xi: estpost sum  social_spending rho_2 rho_3 log_household_income new_educ_2 new_educ_3 civil_status_2 civil_status_3 owner if min2 == 1

. esttab, replace cells("mean(fmt(2))") noobs  ///
> coeflabels(social_spending  "Social Spending" ///
> rho_2 "Risk Rho2" ///
> rho_3 "Risk Rho1" ///
> log_household_income "Household Income (Log)" ///
> new_educ_2 "Medium Education" ///
> new_educ_3 "High Education" ///
> civil_status_2 "Married" /// 
> civil_status_3 "Divorced" /// 
> owner "Owner")

-------------------------
                      (1)
                         
                     mean
-------------------------
Social Spe~g         0.60
Risk Rho2            0.17
Risk Rho1            0.81
Household ~)        11.00
Medium Edu~n         0.47
High Educa~n         0.41
Married              0.59
Divorced             0.11
Owner                0.53
-------------------------

. qui esttab using "tabd2.tex", label booktabs cells("mean(fmt(2))") append nomtitle nonum

. restore

. 
. 
. 
. 
end of do-file

. do "5-tabd3" // Produces Table D3

. /**********************************************
> Table D3: Placebo and Time-Varying Observables
> Author: Raluca L. Pahontu
> ***********************************************/
. 
. qui{

. *Column 1
. qui xtreg nuclear_bi i.rho  $cfe $csim $crest , fe cl(idpers)

. estimate store tabled3column1

. outreg2 using "tabd3.doc", replace  keep(2.rho 3.rho) dec(2)
tabd3.doc
dir : seeout

. 
. *Column 2
. qui xtreg spending_demand i.rho  $cfe $csim $crest public_sector, fe cl(idpers)

. estimate store tabled3column2

. outreg2 using "tabd3.doc", append keep(2.rho 3.rho public_sector)  dec(2)
tabd3.doc
dir : seeout

. 
. *Column 3
. qui xtreg spending_demand i.rho  $cfe $csim $crest left, fe cl(idpers)

. estimate store tabled3column3

. outreg2 using "tabd3.doc", append  keep(2.rho 3.rho left)  dec(2)
tabd3.doc
dir : seeout

. 
. *Column 4
. qui xtreg spending_demand i.rho  $cfe $csim $crest trade_union, fe cl(idpers)

. estimate store tabled3column4

. outreg2 using "tabd3.doc", append keep(2.rho 3.rho trade_union) dec(2)
tabd3.doc
dir : seeout

. 
. *Column 5
. 
. qui xtreg spending_demand i.rho i.canton##c.year i.year $csim $crest, fe cluster(idpers) 

. estimate store tabled3column5

. outreg2 using "tabd3.doc",  append keep(2.rho 3.rho)  dec(2) 
tabd3.doc
dir : seeout

. 
. *Column 6
. qui xtreg spending_demand i.rho  $cfe $csim $crest  if age>25, fe cl(idpers)    

. estimate store tabled3column6

. outreg2 using "tabd3.doc", dec(2)   keep(2.rho 3.rho) append tex
tabd3.tex
tabd3.doc
dir : seeout

.         
. esttab tabled3column* , b(a1) se star(* 0.10 ** 0.05 *** 0.01) keep(2.rho 3.rho) /// 
> coeflabels(2.rho  "Risk Rho2 " 3.rho "Risk Rho1") 

------------------------------------------------------------------------------------------------------------
                      (1)             (2)             (3)             (4)             (5)             (6)   
               nuclear_bi    spending_d~d    spending_d~d    spending_d~d    spending_d~d    spending_d~d   
------------------------------------------------------------------------------------------------------------
Risk Rho2           0.003               0           -0.03**         -0.03**         -0.03*          -0.04** 
                   (0.01)             (.)          (0.02)          (0.02)          (0.02)          (0.02)   

Risk Rho1            0.02           -0.02*          -0.05***        -0.05***        -0.05***        -0.05** 
                   (0.01)         (0.009)          (0.02)          (0.02)          (0.02)          (0.02)   
------------------------------------------------------------------------------------------------------------
N                   38824           29498           39764           39724           39764           34210   
------------------------------------------------------------------------------------------------------------
Standard errors in parentheses
* p<0.10, ** p<0.05, *** p<0.01

. restore

. 
end of do-file

. 
. log close
      name:  <unnamed>
       log:  /Users/raluca/Dropbox/Replication/PSRM/replication/analysis_log.log
  log type:  text
 closed on:   4 Jun 2021, 11:48:30
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
